<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/message.css" />

<?php 
	// get parameter
    $pid = Yii::app()->request->getParam("pid");
    $mid = Yii::app()->request->getParam("mid");
?>

<script>
	$(document).ready(function(){
		$("#comment-wrapper").load('<?php echo $this->createUrl('/comment/index',array('pid'=>$pid,'oid'=>$mid,'ctype'=>'MESSAGE'))?>'	);
	});
</script>

<div class="clear"></div>

			<div id="than">	
           	 	<img src="<?php echo Html::imageUrl("muiten.png");?>" width="27" height="26"; style="float:left">
            	<div id="textxanhdam">Messages </div>
		 	</div>
             <div class="padding15"></div>                    	
            	<!-- Begin leftSidebar -->                  
              	<div id="leftSidebar">
              		<div id="leftWrapper">
              			
						chỗ này làm hiện thông tin của message
						- ngày giờ, người được gửi mail tới ...
						- category ( bỏ category bên mục bên phải đi )
					</div>
				<!-- End leftSidebar -->
				</div>
             	
                <!-- Begin rightSidebar -->
                <div id="rightSidebar">
                	<div id="rightHeader">
						<h2>Messages <h2>
						<div id="viewMessageSubject">
							<?php echo $message->messageCategory->message_category_name ;?>
						</div>
						<div class="mdControl">
                            <?php 
                            	echo Chtml::link("Edit", $this->createUrl("/messages/edit",array('pid'=>$pid, 'mid'=>$mid)),
                            			array(
                                    		'class'=>'mdEdit',
                                    	)
                                     );
                                echo " ";
                                $backLink = $this->createUrl("/messages/index",array('pid'=>$pid));
                                echo Chtml::ajaxLink("Delete", $this->createUrl("/messages/del",array('mid'=>$message->message_id)), 
                                			array(
                                            	'beforeSend'=>'function() {
                                                	return confirm("Are you sure");
                                                }',
                                               	'data'=>array(
                                                	'mid'=>$message->message_id,
                                          		),
                                          		'success'=>"function(data){
													window.location = '$backLink';
												}",
                                      		), 
                                       		array(
                                            	'class'=>'mdDelete',
                                       			'id'=>'mDelete',
                                        	)
                                    	);
                          	?>
                        </div>
					</div>
					
					<div id="rightWrapper">
						<div id="viewMessageWrapper">
							<div class="viewMessageRow">
								<div class="viewMessageRowLeft">
									<div class="viewMessageAvatar">
										<img src="<?php echo Html::imageUrl("a3.png");?>" />
									</div>
									<div class="viewMessageUserName">	
										<a href="#"><?php echo $message->messageSentByUser->user_name;?></a> <br />
										<font color="grey" size="1.5px">
											<?php echo Html::formatDate($message->message_sent_date);?><br />
											<?php echo Html::formatTime($message->message_sent_date);?>
										</font>
									</div>
								</div>
								<div class="viewMessageRowRight">
									<?php echo $message->message_content;?>
								</div>
								<div class="clearfix">
								</div>
							</div>
							
							<div id="comment-wrapper">
								<!-- load by ajax -->
							</id>
						</div>
					</div>
				<!-- End right sidebar -->	
				</div>
                <a href="#"><img src="<?php echo Html::imageUrl("logonho.png");?>" width="145" height="48" border="0" style="float:right; margin-top:20px;"></a>
    </div>	